import React, { Component } from 'react'
import pokemen from "../../JSON/pokemon.json"
import "./Pokemon.css"

export default class HeroList extends Component {
    state = {
        data: []
    }
    render() {
        return (
            <div className="pokemon-list">
                {
                    pokemen.map(item => {
                        return <div key={item.pid} className="item">
                            <img src={item.minipic} alt="" />
                            <p>{item.name}</p>
                        </div>
                    })
                }
            </div>
        )
    }

    async componentDidMount() {
        let result = pokemen.map(item => item);

        this.setState({
            data: result
        })
        console.log(this.state.data)
    }

}
